<?php
include_once("match_repository.php");
$repMatch= new MatchRepository;
$playersT1New=array($_POST['player1T1'],$_POST['player2T1'],$_POST['player3T1']);
$playersT1Old=array($_POST['player1T1_old'],$_POST['player2T1_old'],$_POST['player3T1_old']);
$scaduleId=$_POST['scaduleId'];
for($i=0;$i<3;$i++){
	if ($playersT1New[$i]!=$playersT1Old[$i]){
		$repMatch->updateMatchPlayer1($scaduleId,$playersT1Old[$i],$playersT1New[$i]);
	}	
}

header('LOCATION:'.$_SERVER["HTTP_REFERER"]);
?>